import {http} from "@/interceptor/luch-request/index.js"
// 创建班级
export const saveClass = (data) => {
    return http.post("api/admin/class/v1/saveClass", data,{
	header:{
			"content-type": "application/json"
		}
	});	
}
// 请假类型
export const leaveType = (data) => {
	return http.get("api/admin/leaveType/v1/page", {
		data: data
	});
}
// 请假申请
export const saveLeaveApply = (data) => {
    return http.post("api/admin/leaveApply/v1/saveLeaveApply", data,{
	header:{
			"content-type": "application/json"
		}
	});	
}

// 请假类型保存或修改
export const saveOrUpdateLeaveType = (data) => {
    return http.post("api/admin/leaveType/v1/saveOrUpdateLeaveType", data,{
	header:{
			"content-type": "application/json"
		}
	});	
}


 // 删除请假类型
export const deleteLeaveType = (data) => {
    return http.delete("api/admin/leaveType/v1/deleteLeaveType",data,{
		header:{
			"content-type": "application/json"
		}
	});	
}

// 我申请的请假
export const myApprove = (data) => {
	return http.get("api/admin/leaveApply/v1/myApprove", {
		data: data
	});
}
// 待我审核的
export const myCheck = (data) => {
	return http.get("api/admin/leaveApply/v1/myCheck", {
		data: data
	});
}
// 请假列表
export const pageLeaveApply = (data) => {
	return http.get("api/admin/leaveApply/v1/pageLeaveApply", {
		data: data
	});
}
// 请假详情
 export const infoLeave = (id) => {
  	return http.get("api/admin/leaveApply/v1/info/"+id, {
  		header:{
  			"content-type": "application/x-www-form-urlencoded"
  		}
  	});
 }
// 请假确认
export const leaveConfirmed = (id) => {
return http.get("api/admin/leaveApply/v1/confirmed/"+id, {
	header:{
		"content-type": "application/x-www-form-urlencoded"
	}
});
}
// 请假取消
export const leaveCancel = (id) => {
	return http.post("api/admin/leaveApply/v1/cancel/"+id, {
		header:{
			"content-type": "application/x-www-form-urlencoded"
		}
	});
}

// 导出前生成数据
export const leaveCreate = (data) => {
	return http.get("api/admin/leaveApply/v1/create", {
		data: data
	});
}
